<template>
    <ul class="todo-list">
      <!-- completed: 完成的类名 -->
      <li :class="{completed:itms.isDone}"  v-for="itms in arr" :key="itms.id">
        <div class="view">
          <input class="toggle" type="checkbox" v-model="itms.isDone"/>
          <label>{{itms.name}}</label>
          <button class="destroy" @click="btn(itms.id)"></button>
        </div>
      </li>
    </ul>
    
  </template>
  
  <script>
  export default {
    props:['arr'],
    methods:{
        btn(id){
            this.$emit('clic',id)
        }
    }
  }
  </script>